home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
zbpc_460.zip
/
UTILITY.EXE
/
PERCENT.BAS
< prev
next >
Wrap
BASIC Source File
|
1991-04-11
|
2KB
|
52 lines
'Demonstrates the use of GET and PUT in text modes to save a screen where a
'Pop-up window will be done, then quickly restore it when the window pops down.
CLEAR
COLOR,79 : CLS : DEFINT A-Z
COORDINATE WINDOW 'Do this to save memory in array size in text modes
DIM A(430)
PRINT@(13,16)"Illustrates a pop-up window which shows percentage of a"
PRINT@(13,17)"task completed, then pops down and restores the previous"
PRINT@(13,18)"screen which was loaded into the array using GET in text"
PRINT@(13,19)"mode and restored with PUT."
PRINT@(25,21)"Press any key to begin demonstration"
GET(10,15)-(70,21),A(1)
'Load text into array for restore when window pops down
"Begin" IF INKEY$ = "" GOTO "Begin"
'Define window size and set colors
DEF PAGE 10,15 TO 70,20 : COLOR ,31 : CLS
'Do window borders
PRINT@(10,15) CHR$(218) + STRING$ (58,196) + CHR$(191);
FOR X = 16 TO 20 : PRINT@(10,X) CHR$(179) + STRING$ (58,32) + CHR$(179); : NEXT
PRINT@(10,21) CHR$(192) + STRING$ (58,196) + CHR$(217)" ";
'Start dummy execution
FOR X = 1 TO 100 : COLOR,79 : PRINT@(38,2) RND(5000);
'Display percentage done
COLOR,31 : PRINT@(15,16) STRING$(X/2,177); : PRINT@(30,18) X"% Completed";
FOR Y = 1 TO 5000 : NEXT Y,X
'Ask for command to pop down and restore screen
PRINT@(30,20)"Any key to restore";
"Delay" IF INKEY$ = "" GOTO "Delay"
'Restore full screen DEF PAGE
DEF PAGE 0,0 TO 79,24
'Restore screen from array
PUT(10,15),A(1)
'Freeze until keypress
"Delay1" IF INKEY$ = "" GOTO "Delay1"
CLS